<?php
namespace app\model;

use think\facade\Db;
use think\Model;

class AdminRoles extends Model
{

    protected $name = 'admin_roles';

    public  function  ceshi(){
        Db::startTrans();
        $data =[
            'user_name'=>100,
            'password'=>100,
            'create_time'=>100,
            'update_time'=>100,
        ];
       $save=  self::where(['id'=>37])->update(['admin_id'=>24]);
       $add =  Admin::create($data);
       if ($save && $add){
           Db::commit();
       }else{
           Db::rollback();
       }
        echo  888;
        die();
    }

}